<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>我的订单</title>

    <%-- 静态包含 base标签、css样式、jQuery文件 --%>
    <%@ include file="/pages/common/head.jsp" %>
    <script type="text/javascript">
        $(function () {
            //添加到购物车事件绑定
            $("button.addToCart").click(function () {
                var bookId = $(this).attr("bookId");
                //alert("success");
                location.href = "http://localhost:8080/book/cartServlet?action=addItem&id=" + bookId;
                $("small.successText").css("display", "block");
                setTimeout(function () {
                    $("small.successText").css("display", "none");
                }, 5000);
            });
        });
    </script>
    <link type="text/css" rel="stylesheet" href="static/css/detail.css">
    </style>
</head>
<body>

<div id="header">
    <a href="index.jsp"><img class="logo_img" alt="" src="static/img/logo.gif"></a>
    <span class="wel_word">商品详情</span>
    <%--静态包含，登录 成功之后的菜单 --%>
    <%@ include file="/pages/common/login_success_menu.jsp" %>
</div>
<div class="main_detail">
    <%--最上层展示--%>
    <div class="top_of_detail">
        <img class="detail_img" src="${requestScope.book.imgPath}">
        <div class="right_detail">
            <h2>${requestScope.book.name}</h2>
            <br/><%--数据填充--%>
            <h4>作者：&nbsp;${requestScope.book_detail.author}</h4><br/>
            <h4>ISBN：&nbsp;${requestScope.book_detail.bookISBN}</h4><br/>
            <h4>出版社：&nbsp;${requestScope.book_detail.publisher}</h4><br/>
            <h4>价格：&nbsp;${requestScope.book.price}</h4><br/>
            <button bookId="${book.id}" class="addToCart">加入购物车</button>&nbsp;
            <small style="color:red;display: none" class="successText">加入成功</small>

        </div>
    </div>
    <div class="buttom_detail">
        <b>${requestScope.book_detail.intrucduce}<br/></b>
    </div>
</div>


<%--静态包含页脚内容--%>
<%@include file="/pages/common/footer.jsp" %>


</body>
</html>